package procilege.compute;

import java.util.Collection;

import org.apache.solr.util.OpenBitSet;

import procilege.lang.ExprElement;
import procilege.lang.PrivExprComposition;
import procilege.lang.PrivExprElement;
import procilege.lang.PrivExprMergence;

public interface ExprExpandTraveller extends Traveller {

	PrivExprComposition expandPrivExpr(PrivExprElement expr);

	/**
	 * Set out for the place.
	 */
	Object setout(Object place);

	/**
	 * Report the result or occurrence of the current place.
	 */
	void result(Object result);

	Object getPreviousVisitResult();

	/**
	 * Focus the expr as a context for type inference.
	 */
	void focus(ExprElement expr);

	/**
	 * The neighbor of the place.
	 */
	ExprElement getNeighbor();
	
	void apply(long name, Collection<PrivExprMergence> expr);

	Collection<PrivExprMergence> getApplication(long name);

	/**
	 * The bearer of the expression to expand.
	 */
	OpenBitSet getBoundNames();
	
	void boundname(long name);
	
	ExprExpandTraveller spawn(OpenBitSet boundnames);
	
	ExprExpandTraveller spawn(long boundname);
	
	ExprExpandTraveller spawn(Class<?>[] limitation);
	
	void sayVisitAgain();
}